<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>CGICookieName</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">CGICookieName()</font></b></p>
<p><b>语法</b></p><blockquote>

Result$ = <font color="#3A3966"><b>CGICookieName</b></font>(Index)</blockquote>

<b>概要</b><br><blockquote>



Returns the name of the specified cookie. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>Index</i></td>
<td width="90%"> 
 
The index of the cookie to get the name. The first index value starts from 0. 
To get the number of available cookie, use <a href="countcgicookies.html">CountCGICookies()</a>. 

 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>



Returns the name of the specified cookie. 

 

</blockquote><p><b>示例</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">If</font></b> <b><font color="#3A3966">Not</font></b> <font color="#3A3966">InitCGI</font>() <b><font color="#3A3966">Or</font></b> <b><font color="#3A3966">Not</font></b> <font color="#3A3966">ReadCGI</font>()
    <b><font color="#3A3966">End</font></b>
  <b><font color="#3A3966">EndIf</font></b>
  
<font color="#3A3966">  WriteCGIHeader</font>(<font color="#924B72">#PB_CGI_HeaderContentType</font>, "text/html") <font color="#3A3966">; Write the headers to inform the browser of the content format</font>
<font color="#3A3966">  WriteCGIHeader</font>(<font color="#924B72">#PB_CGI_HeaderSetCookie</font>  , "mycookie=hello", <font color="#924B72">#PB_CGI_LastHeader</font>) <font color="#3A3966">; Write one cookie named 'mycookie'</font>
  
<font color="#3A3966">  WriteCGIString</font>("&lt;html&gt;&lt;title&gt;PureBasic - cookies&lt;/title&gt;&lt;body&gt;" +
                 "NbCookies: " +<font color="#3A3966"> CountCGICookies</font>() + "&lt;br&gt;&lt;br&gt;")

  <font color="#3A3966">; List the all cookies and display their name and value</font>
  <font color="#3A3966">;</font>
  <b><font color="#3A3966">For</font></b> k = 0 <b><font color="#3A3966">To</font></b> <font color="#3A3966">CountCGICookies</font>()-1 
<font color="#3A3966">    WriteCGIString</font>(<font color="#3A3966">CGICookieName</font>(k)+": " +<font color="#3A3966"> CGICookieValue</font>(<font color="#3A3966">CGICookieName</font>(k)) + "&lt;br&gt;")
  <b><font color="#3A3966">Next</font></b>
    
<font color="#3A3966">  WriteCGIString</font>("&lt;/body&gt;&lt;/html&gt;")
</font></pre>

</blockquote><p><b>参阅</b></p><blockquote>

<a href="countcgicookies.html">CountCGICookies()</a>, <a href="cgicookievalue.html">CGICookieValue()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=cgibuffer.html>CGIBuffer()</a> - <a href="index.html">CGI Index</a> - <a href="cgicookievalue.html">CGICookieValue()</a> -&gt;<br><br>

</body></html>